import { putRequest, postRequest, deleteRequest, getRequest } from '@/api/instance'
const serve = 'backendAuthority/'

export const getPageList = ( data ) => {
  return postRequest( `${serve}authority/api/authority/pageList`, { data, showLoading: true })
}

export const addAuthority = ( data ) => {
  return postRequest( `${serve}authority/api/authority`, { data, showLoading: true })
}

export const editAuthority = ( data ) => {
  return putRequest( `${serve}authority/api/authority`, { data, showLoading: true })
}

export const delAuthority = ( id ) => {
  return deleteRequest( `${serve}authority/api/authority/${id}`, { showLoading: true })
}

// 权限状态变更接口
export const statusAuthority = ( data ) => {
  return putRequest( `${serve}authority/api/authority/status`, { data, showLoading: true })
}

// 权限查询接口
export const getAuthorityDetail = ( id ) => {
  return getRequest( `${serve}authority/api/authority/${id}`, { showLoading: true })
}

// 行业数据权限分类查询接口
export const getCategoryList = ( data ) => {
  return postRequest( `${serve}authority/api/category/pageList`, { data, showLoading: true })
}

// 权限助记符校验接口
export const checkMnemonic = ( params ) => {
  return getRequest( `${serve}authority/api/authority/checkMnemonic`, { params, showLoading: true })
}

// 权限状态变更检查接口
export const authorityCheckStatus = ( params ) => {
  return getRequest( `${serve}authority/api/authority/checkStatus`, { params })
}


// 权限点删除验证
export const authorityCheckRemove = ( params ) => {
  return getRequest( `${serve}authority/api/authority/checkRemove/${params}`, )
}


